package com.d2rv.experience;

import com.d2rv.settings.Settings;
import processing.core.PApplet;

/**
 * This class contains the settings and the initialisation phase of the
 * application
 *
 * @author Darrieutort A., Dupouy A., Rossignol L., Van Poucke A.
 */
public class Experience {

    private SceneManager scenemanager;

    /**
     * Default constructor
     *
     * @param parent The current application
     */
    public Experience(PApplet parent) {
        Settings settings = Settings.getInstance();
        settings.init(parent.dataPath("settings.xml"));
        this.scenemanager = new SceneManager(parent);
    }

    /**
     * Calls the drawing method of the scene manager to start the rendering.
     *
     * @param parent The current application
     * @param mode the mode of the application (0:mono 1:anaglyphe 2:side by
     * side)
     */
    public void draw(PApplet parent, int mode) {
        this.scenemanager.draw(mode);
        this.scenemanager.show(parent, mode);
    }
    
    /**
     * Returns the manager of the scene
     *
     * @return the manager of the scene
     */
    public SceneManager scenemanager() {
        return this.scenemanager;
    }
}